package com.way.Java多线程编程核心技术v2.chapter02_对象及变量的并发访问._2_1_synchronized同步方法.实例变量非线程安全问题与解决方案;

/**
 * @PROJECT_NAME: projects
 * @DESCRIPTION:
 * @USER: 魏彪
 * @DATE: 2023/11/27 15:55
 */
public class ThreadB extends Thread {

    private HasSelfPrivateNum ref;

    public ThreadB(HasSelfPrivateNum ref) {
        this.ref = ref;
    }

    @Override
    public void run() {
        ref.addI("b");
    }
}
